// Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.kpdus.com/jad.html
// Decompiler options: packimports(3) 

package com.nnee.p_c.p_a;

import java.util.Hashtable;

// Referenced classes of package com.nnee.c.a:
//            c, b

public class cls_e
{

    public cls_e(cls_c c1)
    {
        e = 64;
        c = c1;
        d = c1.e();
        Integer integer = (Integer)h.get(c1.d());
        if(integer == null)
        {
            throw new IllegalArgumentException("unknown digest passed");
        } else
        {
            e = integer.intValue();
            f = new byte[e];
            g = new byte[e];
            return;
        }
    }

    public int a(byte abyte0[], int i)
    {
        byte abyte1[] = new byte[d];
        c.b(abyte1, 0);
        c.a(g, 0, g.length);
        c.a(abyte1, 0, abyte1.length);
        int j = c.b(abyte0, i);
        d();
        return j;
    }

    public String a()
    {
        return (new StringBuilder()).append(c.d()).append("/HMAC").toString();
    }

    public void a(byte byte0)
    {
        c.a(byte0);
    }

    public void a(cls_b b1)
    {
        c.b();
        byte abyte0[] = b1.a();
        if(abyte0.length > e)
        {
            c.a(abyte0, 0, abyte0.length);
            c.b(f, 0);
            for(int l = d; l < f.length; l++)
                f[l] = 0;

        } else
        {
            System.arraycopy(abyte0, 0, f, 0, abyte0.length);
            for(int i = abyte0.length; i < f.length; i++)
                f[i] = 0;

        }
        g = new byte[f.length];
        System.arraycopy(f, 0, g, 0, f.length);
        for(int j = 0; j < f.length; j++)
        {
            byte abyte2[] = f;
            abyte2[j] = (byte)(0x36 ^ abyte2[j]);
        }

        for(int k = 0; k < g.length; k++)
        {
            byte abyte1[] = g;
            abyte1[k] = (byte)(0x5c ^ abyte1[k]);
        }

        c.a(f, 0, f.length);
    }

    public void a(byte abyte0[], int i, int j)
    {
        c.a(abyte0, i, j);
    }

    public cls_c b()
    {
        return c;
    }

    public int c()
    {
        return d;
    }

    public void d()
    {
        c.b();
        c.a(f, 0, f.length);
    }

    private static final byte a = 54;
    private static final byte b = 92;
    private static Hashtable h;
    private cls_c c;
    private int d;
    private int e;
    private byte f[];
    private byte g[];

    static 
    {
        h = new Hashtable();
        h.put("GOST3411", new Integer(32));
        h.put("MD2", new Integer(16));
        h.put("MD4", new Integer(64));
        h.put("MD5", new Integer(64));
        h.put("RIPEMD128", new Integer(64));
        h.put("RIPEMD160", new Integer(64));
        h.put("SHA-1", new Integer(64));
        h.put("SHA-224", new Integer(64));
        h.put("SHA-256", new Integer(64));
        h.put("SHA-384", new Integer(128));
        h.put("SHA-512", new Integer(128));
        h.put("Tiger", new Integer(64));
        h.put("Whirlpool", new Integer(64));
    }
}
